#include "Item.h"
#include<QPixmap>
#include<QDebug>

Item::Item()
{
    this->setPixmap(QPixmap(":/bg/qt.picture/bg1.jpg") );
}
void Item::setPic(QString path)
{
    this->setPixmap(QPixmap(path));
}
void Item::mousePressEvent(QGraphicsSceneMouseEvent *event){   //鼠标点击图元

    //检验点击图元有反应
   // qDebug()<<"鼠标点击";

    if(this->isMouse()){
        qDebug()<<"打中";
    }
    else{
        qDebug()<<"未打中";
    }
}
void Item::setMouse(bool mouse)
{
    this->mouse=mouse;
}
bool Item::isMouse()
{
    return this->mouse;
}
